<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2018-01-25 16:10:36
 * @Description: 砍价配置，营销类商品不可有规格
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-20 10:31:06
 * @FilePath: /qingshanERP/database/migrations/b2b/expand/2018_01_25_153634_create_bargaons.php
 */

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBargaons extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bargains', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('shop_id')->default(0)->comment('门店ID');
            $table->foreignId('good_id')->default(0)->comment('商品ID');
            $table->string('good_title',255)->default('')->comment('商品标题');
            $table->string('title',255)->default('')->comment('标题');
            $table->string('describe',500)->default('')->comment('描述');
            $table->decimal('price',10,2)->default(0)->comment('价格');
            $table->unsignedInteger('store')->default(0)->comment('库存');
            $table->decimal('bargain_price',10,2)->default(0)->comment('每次砍价格');
            $table->integer('maxnum')->default(0)->comment('最多砍几次');
            $table->dateTime('starttime')->default('2021-10-10 00:00:00')->comment('开始时间');
            $table->dateTime('endtime')->default('2021-10-10 00:00:00')->comment('结束时间');
            $table->integer('sort')->default(0)->comment('排序');
            $table->boolean('status')->default(1)->comment('状态：1正常，0关闭');
            $table->tinyInteger('del_flag')->default(0)->comment('删除状态：0正常，1关闭');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('bargains');
    }
}
